<template>
  <ElDatePicker v-model="value" :="attrs" />
</template>

<script setup lang="ts">
import { computed, useAttrs  } from 'vue'
import { ElDatePicker } from 'element-plus'
interface Props {
  startDate: string;
  endDate: string;
}
const props = withDefaults(defineProps<Props>(), {
  startDate: '',
  endDate: ''
})

const attrs = useAttrs()

const emit = defineEmits()

const value = computed<any>({
  get() {
    return [props.startDate, props.endDate]
  },
  set(val) {
    const v = val || []
    emit('update:startDate', v[0])
    emit('update:endDate', v[1])
  }
})

</script>
